let profileComponent = {
    template: `
        <div class="profile page">
            <div class="head">
                <div class="left" @click="back">
                    <span class="iconfont icon-ali-fanhui"></span>
                </div>
                <div class="title">profile</div>
                <div class="right"></div>
            </div>
            <div class="item">
                <div class="label">name:</div>
                <div class="value">{{user.name}}</div>
            </div>
            <div class="item">
                <div class="label">email:</div>
                <div class="value">{{user.email}}</div>
            </div>
          
           <el-button @click="logout" style="margin: 0 auto 0 auto;width: 80px;">logout</el-button>
        </div>
    `,
    data() {
        return {
           user:{}
        }

    },
    computed: {},
    watch: {},
    mounted() {
        this.user = user.user
    },
    activated() {

    },
    methods: {
        logout(){
            user.logout().then(()=>{
                window.location.reload()
            })
        },
        back(){
            this.$router.back()
        }
    },
    components: {},
    beforeRouteLeave(to, from, next) {

        next();
    }
}

